package com.powersystem.demo.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.powersystem.demo.entity.PsSystemconfig;
import com.powersystem.demo.mapper.PsSystemconfigMapper;
import com.powersystem.demo.service.IPsSystemconfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 * @author 系統配置
 * @since 2019-11-14
 */
@RestController
public class PsSystemconfigController {
    @Autowired
    private IPsSystemconfigService ipscs;

//插入一條記錄
    @RequestMapping("addSystemconfig")
    public boolean addSystemconfig(PsSystemconfig psc){
        return ipscs.save(psc);
    }

// 根據ID修改是否啓動
    @RequestMapping("upSystemconfig")
    public boolean upSystemconfig(PsSystemconfig psc){
        return ipscs.updateById(psc);
    }

// 根據ID刪除
@RequestMapping("deleSystemconfig")
    public boolean deleSystemconfig(int id){
        return ipscs.removeById(id);
    }

// 分頁查詢
    @RequestMapping("listSystemconfig")
    public IPage<PsSystemconfig> listSystemconfig(int page){
        return ipscs.selectPageVo("",page);
    }
}

